/**
 * @param {number[]} nums
 * @return {number}
 */
 var minMoves = function(nums) {
  let minNum = Math.min(...nums)
  let count=0
  for(const num of nums){
    count+=num-minNum
  }

  return count
};